A portable device such as a cellular phone or a smart phone can now be equipped with an electronic compass. The compass calculates and provides its user with a direction, which may be a “heading” (typically given relative to the Earth's magnetic field which is also referred to as the geomagnetic field), and/or an arrow pointing to true north. The direction information may be provided for the user's own navigation knowledge, for example, to tell him which way is north while he is walking or driving in unfamiliar surroundings. The direction information is also beneficial for use by a navigation or map application that may be running in the device.
The electronic compass obtains a measure of the magnetic field that is present in its immediate surrounding as a three-component (e.g., in x, y, and z directions) vector, using a 3-axis magnetic sensor. The sensed field contains a contribution by the Earth's magnetic field, and a contribution by a so-called local interference field. The latter is the magnetic field that is created by components in the local environment of the portable device. This may include contributions by any magnetic component that is near the sensor, such as a loudspeaker that is built into the device. The interference field may also have a contribution due to magnetic elements found in the external environment close to the device, such as when the user is driving an automobile, riding in a train or bus, or riding on a bicycle or motorcycle.
In most cases, the interference field is not negligible relative to the Earth field. Therefore, a calibration procedure is needed to estimate and then remove the interference field contribution from the sensor's measurements, in order to allow the compass to calculate the correct direction at that moment. There are several types of 3-axis calibration procedures. In one such technique, the user is instructed to rotate the device (containing the compass) according to a set of geometrically different orientations and azimuth angles, while measurements by the compass and by an orientation sensor are collected and analyzed so as to isolate or solve for the interference field. The solved interference field is then removed from a measurement taken by the magnetic sensor, to yield the geomagnetic field (which may then be further corrected into the true north direction).
In another 3-axis calibration technique, rather than instruct the user to deliberately rotate the device in a predetermined manner, many measurements are collected from the compass, continuously over a period of time, while the device is being used or carried by the user in the usual course. This typically leads to random albeit sufficient rotations of the device, which enable solving for the interference field. This technique is desirably transparent to the user because the user is not required to go through a procedure where he must deliberately rotate the device through a specified set of orientations.
The magnetic conditions surrounding the magnetic sensor typically change over time, for example as the user carrying the portable device moves into different locations, reconfigures the device (e.g., opens or closes a clam shell type cellular phone), or places the device near objects that have different magnetic signatures. The magnetic sensor can also drift over time. As a result, the compass needs to be recalibrated often. With existing techniques, calibration output data is verified by comparing it to certain calibration criteria; the data is either rejected (if the criteria are not met) or it is passed on to a heading computation process (if the criteria are met). Once a new heading has been computed using the validated calibration output data, the new heading is verified by comparing it to certain heading criteria; the new heading is either rejected (if the criteria are not met) or accepted (if the criteria are met), where in the latter case it will then be displayed to the user or used by a navigation application running in the portable device.